﻿using Rafy;
using Rafy.ComponentModel;
using Rafy.Data;
using Rafy.Domain;
using Rafy.Domain.ORM;
using Rafy.Domain.ORM.Query;
using Rafy.Domain.Validation;
using Rafy.ManagedProperty;
using Rafy.MetaModel;
using Rafy.MetaModel.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Text;

namespace Rafy.YuWen
{
    /// <summary>
    /// 一个汉字
    /// </summary>
    [RootEntity]
    public partial class Base_Word : YuWenEntity
    {
        #region 引用属性

        #endregion

        #region 组合子属性

        #endregion

        #region 一般属性
        public static readonly Property<string> F_NameProperty = P<Base_Word>.Register(e => e.F_Name);
        /// <summary>
        /// 汉字
        /// </summary>
        public string F_Name
        {
            get { return this.GetProperty(F_NameProperty); }
            set { this.SetProperty(F_NameProperty, value); }
        }
        public static readonly Property<string> F_PinYinProperty = P<Base_Word>.Register(e => e.F_PinYin);
        /// <summary>
        /// 拼音
        /// </summary>
        public string F_PinYin
        {
            get { return this.GetProperty(F_PinYinProperty); }
            set { this.SetProperty(F_PinYinProperty, value); }
        }
        public static readonly Property<string> F_PinYinsProperty = P<Base_Word>.Register(e => e.F_PinYins);
        /// <summary>
        /// 拼音无音节
        /// </summary>
        public string F_PinYins
        {
            get { return this.GetProperty(F_PinYinsProperty); }
            set { this.SetProperty(F_PinYinsProperty, value); }
        }


        public static readonly Property<string> F_BuShouProperty = P<Base_Word>.Register(e => e.F_BuShou);
        /// <summary>
        /// 部首
        /// </summary>
        public string F_BuShou
        {
            get { return this.GetProperty(F_BuShouProperty); }
            set { this.SetProperty(F_BuShouProperty, value); }
        }
        public static readonly Property<string> F_BiHuaProperty = P<Base_Word>.Register(e => e.F_BiHua);
        /// <summary>
        /// 笔画
        /// </summary>
        public string F_BiHua
        {
            get { return this.GetProperty(F_BiHuaProperty); }
            set { this.SetProperty(F_BiHuaProperty, value); }
        }
        public static readonly Property<string> F_JieShiProperty = P<Base_Word>.Register(e => e.F_JieShi);
        /// <summary>
        /// 解释
        /// </summary>
        public string F_JieShi
        {
            get { return this.GetProperty(F_JieShiProperty); }
            set { this.SetProperty(F_JieShiProperty, value); }
        }
        public static readonly Property<string> F_ZuCiProperty = P<Base_Word>.Register(e => e.F_ZuCi);
        /// <summary>
        /// 组词
        /// </summary>
        public string F_ZuCi
        {
            get { return this.GetProperty(F_ZuCiProperty); }
            set { this.SetProperty(F_ZuCiProperty, value); }
        }
        public static readonly Property<string> F_JinYiCiProperty = P<Base_Word>.Register(e => e.F_JinYiCi);
        /// <summary>
        /// 近义词
        /// </summary>
        public string F_JinYiCi
        {
            get { return this.GetProperty(F_JinYiCiProperty); }
            set { this.SetProperty(F_JinYiCiProperty, value); }
        }
        public static readonly Property<string> F_FanYiCiProperty = P<Base_Word>.Register(e => e.F_FanYiCi);
        /// <summary>
        /// 反义词
        /// </summary>
        public string F_FanYiCi
        {
            get { return this.GetProperty(F_FanYiCiProperty); }
            set { this.SetProperty(F_FanYiCiProperty, value); }
        }

        public static readonly Property<string> F_BiShunProperty = P<Base_Word>.Register(e => e.F_BiShun);
        /// <summary>
        /// 笔顺地址
        /// </summary>
        public string F_BiShun
        {
            get { return this.GetProperty(F_BiShunProperty); }
            set { this.SetProperty(F_BiShunProperty, value); }
        }
        public static readonly Property<string> F_FaYinProperty = P<Base_Word>.Register(e => e.F_FaYin);
        /// <summary>
        /// 发音地址
        /// </summary>
        public string F_FaYin
        {
            get { return this.GetProperty(F_FaYinProperty); }
            set { this.SetProperty(F_FaYinProperty, value); }
        }
        public static readonly Property<string> F_ZiKaProperty = P<Base_Word>.Register(e => e.F_ZiKa);
        /// <summary>
        /// 字卡地址
        /// </summary>
        public string F_ZiKa
        {
            get { return this.GetProperty(F_ZiKaProperty); }
            set { this.SetProperty(F_ZiKaProperty, value); }
        }
        #endregion

        #region 只读属性

        #endregion
    }

    /// <summary>
    /// 一个汉字 列表类。
    /// </summary>
    public partial class Base_WordList : YuWenEntityList<Base_Word> { }

    /// <summary>
    /// 一个汉字 仓库类。
    /// 负责 一个汉字 类的查询、保存。
    /// </summary>
    public partial class Base_WordRepository : YuWenEntityRepository
    {
        /// <summary>
        /// 单例模式，外界不可以直接构造本对象。
        /// </summary>
        protected Base_WordRepository() { }
    }

    /// <summary>
    /// 一个汉字 配置类。
    /// 负责 一个汉字 类的实体元数据的配置。
    /// </summary>
    internal class Base_WordConfig : YuWenEntityConfig<Base_Word>
    {
        /// <summary>
        /// 配置实体的元数据
        /// </summary>
        protected override void ConfigMeta()
        {
            //配置实体的所有属性都映射到数据表中。
            Meta.MapTable().MapAllProperties();
        }
    }
}